package com.clippick;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.clippick.clipboard.PollingService;
import com.clippick.clipboard.ShorcutNotificationService;
import com.clippick.common.GlobalValue;

public class ClipPickReciever extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		// reboot
		if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
			Log.d("RestartService", "ACTION_BOOT_COMPLETED / ClIPPICK START");
			Intent i = new Intent(context, PollingService.class);
			context.startService(i);

			if (GlobalValue.isShowNotification(context)) {
				Intent notifIntent = new Intent(context,
						ShorcutNotificationService.class);
				context.startService(notifIntent);
			}
		}
	}
}
